package com.ptu.spzx.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ptu.spzx.domain.Class.Classes;
import com.ptu.spzx.domain.Class.dto.ClassPageDto;
import com.ptu.spzx.domain.Class.dto.ClassesUpdateDTO;
import com.ptu.spzx.domain.Class.vo.ClassesQueryResultVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author YT
 * @since 2024-01-28
 */
@Mapper
public interface ClassesMapper extends BaseMapper<Classes> {

    @Select("SELECT * from classes where name=#{name} AND is_delete=0")
    Classes selectByName(String name);


    @Select("SELECT id from classes WHERE name=#{name}")
    Long seectByName(String name);

    @Select("SELECT class_id FROM exam_class WHERE exam_id=#{id}")
    List<Long> selectByExamId(Long id);

    @Select("SELECT name from classes WHERE id=#{classId}")
    List<String> selectNameByClassId(Long classId);
}
